.TH "Sending IRC commands." 3 "30 Sep 2004" "Version 0.1" "libirc" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Sending IRC commands. \- 
.SS "Functions"

.in +1c
.ti -1c
.RI "int \fBirc_send_raw\fP (\fBirc_session_t\fP *session, const char *format,...)"
.br
.RI "\fISends raw data to the IRC server. \fP"
.ti -1c
.RI "int \fBirc_cmd_quit\fP (\fBirc_session_t\fP *session, const char *reason)"
.br
.RI "\fISends QUIT command to the IRC server. \fP"
.ti -1c
.RI "int \fBirc_cmd_join\fP (\fBirc_session_t\fP *session, const char *channel, const char *key)"
.br
.RI "\fIJoins the new IRC channel. \fP"
.ti -1c
.RI "int \fBirc_cmd_msg\fP (\fBirc_session_t\fP *session, const char *nch, const char *text)"
.br
.RI "\fISends the message to the nick or to the channel. \fP"
.ti -1c
.RI "int \fBirc_cmd_me\fP (\fBirc_session_t\fP *session, const char *nch, const char *text)"
.br
.RI "\fISends the /me (CTCP ACTION) message to the nick or to the channel. \fP"
.ti -1c
.RI "int \fBirc_cmd_notice\fP (\fBirc_session_t\fP *session, const char *nch, const char *text)"
.br
.RI "\fISends the notice to the nick or to the channel. \fP"
.ti -1c
.RI "int \fBirc_cmd_kick\fP (\fBirc_session_t\fP *session, const char *nick, const char *channel, const char *reason)"
.br
.RI "\fIKick some lazy ass out of channel. \fP"
.in -1c
.SH "Function Documentation"
.PP 
.SS "int irc_cmd_join (\fBirc_session_t\fP * session, const char * channel, const char * key)"
.PP
Joins the new IRC channel. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP An initiated and connected session. 
.br
\fIchannel\fP A channel name to join to. Must not be NULL. 
.br
\fIkey\fP Channel password. May be NULL.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. Any error, generated by the IRC server, is available through event_numeric.
.RE
.PP
This function is used to JOIN the IRC channel. If the channel is not exist, it will be automatically created by the IRC server. Note that to JOIN the password-protected channel, you must know the password, and specify it in the \fIkey\fP argument. 
.SS "int irc_cmd_kick (\fBirc_session_t\fP * session, const char * nick, const char * channel, const char * reason)"
.PP
Kick some lazy ass out of channel. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP An initiated and connected session. 
.br
\fInick\fP A nick to kick. Must not be NULL. 
.br
\fIchannel\fP A channel to kick this nick out of. Must not be NULL. 
.br
\fIreason\fP A reason to kick. May be NULL.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. Any error, generated by the IRC server, is available through ::event_numeric.
.RE
.PP
This function is used to kick a person out of channel. Note that you must be a channel operator to kick anyone.
.PP
\fBSee also:\fP
.RS 4
event_numeric 
.RE
.PP

.SS "int irc_cmd_me (\fBirc_session_t\fP * session, const char * nch, const char * text)"
.PP
Sends the /me (CTCP ACTION) message to the nick or to the channel. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP An initiated and connected session. 
.br
\fInch\fP A target nick or channel. Must not be NULL. 
.br
\fItext\fP Action message text. Must not be NULL.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. Any error, generated by the IRC server, is available through event_numeric.
.RE
.PP
This function is used to send the /me message to channel or private. As for irc_cmd_msg, the target is determined by \fInch\fP argument.
.PP
\fBSee also:\fP
.RS 4
\fBirc_cmd_msg\fP 
.RE
.PP

.SS "irc_cmd_msg (\fBirc_session_t\fP * session, const char * nch, const char * text)"
.PP
Sends the message to the nick or to the channel. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP An initiated and connected session. 
.br
\fInch\fP A target nick or channel. Must not be NULL. 
.br
\fItext\fP Message text. Must not be NULL.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. Any error, generated by the IRC server, is available through event_numeric.
.RE
.PP
This function is used to send the channel or private messages. The target is determined by \fInch\fP argument: if it describes nick, this will be a private message, if a channel name - public (channel) message. Note that depending on channel modes, you may be required to join the channel to send the channel messages. 
.SS "int irc_cmd_notice (\fBirc_session_t\fP * session, const char * nch, const char * text)"
.PP
Sends the notice to the nick or to the channel. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP An initiated and connected session. 
.br
\fInch\fP A target nick or channel. Must not be NULL. 
.br
\fItext\fP Notice text. Must not be NULL.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. Any error, generated by the IRC server, is available through event_numeric.
.RE
.PP
This function is used to send the channel or private notices. The target is determined by \fInch\fP argument: if it describes nick, this will be a private message, if a channel name - public (channel) message. Note that depending on channel modes, you may be required to join the channel to send the channel notices.
.PP
The only difference between message and notice is that, according to RFC 1459, you must not automatically reply to NOTICE messages.
.PP
\fBSee also:\fP
.RS 4
\fBirc_cmd_msg\fP 
.RE
.PP

.SS "int irc_cmd_quit (\fBirc_session_t\fP * session, const char * reason)"
.PP
Sends QUIT command to the IRC server. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP An initiated and connected session. 
.br
\fIreason\fP A reason to quit. May be NULL.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. Any error, generated by the IRC server, is available through event_numeric.
.RE
.PP
This function sends the QUIT command to the IRC server. This command forces the IRC server to close the IRC connection, and terminate the session. 
.SS "int irc_send_raw (\fBirc_session_t\fP * session, const char * format,  ...)"
.PP
Sends raw data to the IRC server. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP An initiated and connected session. 
.br
\fIformat\fP A printf-formatted string, followed by function args.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. Any error, generated by the IRC server, is available through event_numeric.
.RE
.PP
This function sends the raw data as-is to the IRC server. Use it to generate a server command, which is not (yet) provided by libirc directly. 
